<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Random Numbers from Congruential Generator RANDU</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="R.css">
</head><body>

<table width="100%" summary="page for randu"><tr><td>randu</td><td align="right">R Documentation</td></tr></table>

<h2>Random Numbers from Congruential Generator RANDU</h2>

<h3>Description</h3>


<p>400 triples of successive random numbers were taken from the VAX
FORTRAN function RANDU running under VMS 1.5.
</p>


<h3>Usage</h3>

<pre>randu</pre>


<h3>Format</h3>


<p>A data frame with 400 observations on 3 variables named <code>x</code>,
<code>y</code> and <code>z</code> which give the first, second and third random
number in the triple.
</p>


<h3>Details</h3>


<p>In three dimensional displays it is evident that the triples fall on
15 parallel planes in 3-space. This can be shown theoretically to be
true for all triples from the RANDU generator.
</p>
<p>These particular 400 triples start 5 apart in the sequence, that is
they are ((U[5i+1], U[5i+2], U[5i+3]), i= 0, ..., 399), and they
are rounded to 6 decimal places.
</p>
<p>Under VMS versions 2.0 and higher, this problem has been fixed.
</p>


<h3>Source</h3>


<p>David Donoho
</p>


<h3>Examples</h3>

<pre>
## Not run: ## We could re-generate the dataset by the following R code
seed &lt;- as.double(1)
RANDU &lt;- function() {
    seed &lt;&lt;- ((2^16 + 3) * seed) %% (2^31)
    seed/(2^31)
}
for(i in 1:400) {
    U &lt;- c(RANDU(), RANDU(), RANDU(), RANDU(), RANDU())
    print(round(U[1:3], 6))
}
## End(Not run)
</pre>


</body></html>
